package rrrmai.viewbinder;

import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
import android.databinding.BaseObservable;
import android.support.annotation.NonNull;

import java.io.Serializable;

import rrrmai.utils.Md5;


/**
 * Created by summer on 2018/2/28.
 */
@Entity
public class Contact  extends BaseObservable implements Serializable{
    //hashId
    @NonNull
    @PrimaryKey
    private String  id;
    private String  name;
    private String  mobile;
    //对这个人的描述,可以是有人对他进行了评价等
    private String  desc;
    //红点 消息数
    private String  badge;
    //关注账号的状态
    private  int state;
    //是否关注状态中 页面中显示 关注/取消 按钮
    private  int follow;

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getFollow() {
        return follow;
    }

    public void setFollow(int follow) {
        this.follow = follow;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.id=Md5.getMD5Str(mobile);
        if (mobile.length()>4){
            this.mobile = "1****"+mobile.substring(mobile.length()-4,mobile.length());
        }else{
            this.mobile=mobile;
        }
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getBadge() {
        return badge;
    }

    public void setBadge(String badge) {
        this.badge = badge;
    }
}